package com.ruoyi.factorydata.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.*;

import java.math.BigDecimal;

/**
 * 领料单详情对象 material_requisition_detail
 *
 * @author ruoyi
 * @date 2025-07-29
 */
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(resultMap = "com.ruoyi.factorydata.mapper.MaterialRequisitionDetailMapper.MaterialRequisitionDetailResult")
public class MaterialRequisitionDetail extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 领料单ID
     */
    @Excel(name = "领料单ID")
    private Long requisitionId;

    /**
     * 领料单号
     */
    @Excel(name = "领料单号")
    private String requisitionNo;
    /**
     * 批次编号
     */
    @Excel(name = "批次编号")
    private String batchNumber;

    /**
     * 项目ID
     */
    @Excel(name = "项目ID")
    private Long projectId;

    /**
     * 计划ID
     */
    @Excel(name = "计划ID")
    private Long planId;

    /**
     * 工单ID
     */
    @Excel(name = "工单ID")
    private Long workOrderId;

    /**
     * 类型：1-物料 2-母版
     */
    @Excel(name = "类型：1-物料 2-母版")
    private Integer type;

    /**
     * 物料id
     */
    @Excel(name = "物料id")
    private Long materialId;

    /**
     * 产品编码
     */
    @Excel(name = "产品编码")
    private String materialCode;

    /**
     * 产品名称
     */
    @Excel(name = "产品名称")
    private String materialName;

    /**
     * 产品类型
     */
    @Excel(name = "产品类型")
    private String materialType;

    /**
     * 产品规格
     */
    @Excel(name = "产品规格")
    private String materialSpecification;

    /**
     * 计量单位id
     */
    @Excel(name = "计量单位id")
    private Long materialUnit;

    /**
     * 计量单位名称
     */
    @Excel(name = "计量单位名称")
    private String materialUnitName;

    /**
     * 物料分类
     */
    @Excel(name = "物料分类")
    private Long materialCategoryId;

    /**
     * 制造方式
     */
    @Excel(name = "制造方式")
    private String manufacturingMethod;

    /**
     * 母版来源
     */
    @Excel(name = "母版来源")
    private String modelSource;

    /**
     * 母版编号
     */
    @Excel(name = "母版编号")
    private String modelNumber;

    /**
     * 需求数量
     */
    @Excel(name = "需求数量")
    private BigDecimal requiredQuantity;

    /**
     * 库存数量
     */
    @Excel(name = "库存数量")
    private BigDecimal inventoryQuantity;

    /**
     * 缺料数量
     */
    @Excel(name = "缺料数量")
    private BigDecimal shortageQuantity;

    /**
     * 已领数量
     */
    @Excel(name = "已领数量")
    private BigDecimal receivedQuantity;

    /**
     * 退料数量
     */
    @Excel(name = "退料数量")
    private BigDecimal returnedQuantity;

    /**
     * 申请退料数量
     */
    @Excel(name = "申请退料数量")
    private BigDecimal applyReturnedQuantity;

    /**
     * 版本号
     */
    @Excel(name = "版本号")
    @Version
    private Integer version;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic(value = "0", delval = "2")
    private String delFlag;

    /**
     * 状态
     */
    @TableField(exist = false)
    private Integer status;

    /**
     * 母版信息
     */
    @TableField(exist = false)
    private ModelInventory modelInventory;

    /**
     * 批次编号审批：物料批次编号|出库数量,母版批次编号|出库数量
     */
    @TableField(exist = false)
    private String batchNumberStr;

}